/**
 * Created by 86135 on 2020/2/19.
 */
public class Test11 {
    public static void main(String[] args) {

        int [] arr= {1,3,5,7,9};
        int i = maxNO2(arr);
        System.out.println(i);

    }
    public static int maxNO2(int[] arr){
        int no1 = 0;
        for (int i = 0; i < arr.length; i++) {
            if (no1 < arr[i]){
                no1 = arr[i];
            }
        }

        int no2 = 0;
        for (int i = 0; i < arr.length; i++) {
            if (no2 < arr[i] ){
                if (arr[i] != no1){
                    no2 = arr[i];
                }
            }
        }
        return no2;
    }
}
